package com.boot.ch4;

import java.util.Map;

/**
 * @author onlyone
 */
public class HandlerContext {

    private Map<String, Object> orderServiceMap;

    public HandlerContext(Map<String, Object> orderServiceMap){
        this.orderServiceMap = orderServiceMap;
    }

    public IOrderService getInstanceByType(String type) {
        return (IOrderService) orderServiceMap.get(type);
    }
}
